<?php

/**
 * Allows developer to select a specific page to load if user agent is a crawl robot
 *
 */
class RobotSwitcher
{
	/**
	 * returns true if user agent is a robot
	 */
	public static function isSearchBot()
	{
		$userAgent = $_SERVER['HTTP_USER_AGENT'];
		
		$bots = array();
		$bots[] = 'Googlebot';
		$bots[] = 'msnbot';
		$bots[] = 'Slurp';
		
		foreach($bots as $bot)
		{
			if(strpos($userAgent, $bot) !== false)
				return true;
		}
		
		return false;
	}
}
?>